<?php
defined('_JEXEC') or die( 'Restricted access' );

jimport( 'joomla.application.component.view');

class igphotoViewEdit_photo extends JView
{
	function display($tpl = null)
	{
		$photo    =& $this->get('Photo');

		JToolBarHelper::title( JText::_('EDIT PHOTO DETAILS'),'generic.png' );
		JToolBarHelper::apply();
		JToolBarHelper::save();
		JToolBarHelper::custom('save_and_next', 'restore.png', 'restore.png', JText::_( 'SAVE AND NEXT' ), false);
		JToolBarHelper::cancel();

        if(! $thumbFile = igFileHelper::originalToResized($photo->filename, $photo->thumb_width, $photo->thumb_height, 
        $photo->img_quality, $photo->crop_thumbs, $photo->rotation, $photo->round_thumb, $photo->round_fill) )
	    {
	        return false;
	    }

		//make the html form items
        $lists = array();
        $lists['target_blank'] = JHTML::_('select.booleanlist',  'target_blank', 'class="inputbox"', $photo->target_blank);
		$lists['access'] = JHTML::_('list.accesslevel', $photo);
		$lists['user'] = igHtmlHelper::getUserList($photo->user);

		$this->assignRef('thumbFile', $thumbFile);
		$this->assignRef('lists',     $lists);
		$this->assignRef('photo',	  $photo);

		parent::display($tpl);
    }
}